package main

import (
	"algorithms/array"
	"fmt"
)

func main() {

	arr := array.MakeArray0[Integer](10)
	for i := 0; i < 10; i++ {
		//接口变量，需手动装箱
		arr.AddLast(Integer(i))
	}
	fmt.Println(arr)

	arr.Add(1, 100)
	fmt.Println(arr)

	arr.AddFirst(-1)
	fmt.Println(arr)

	arr.Remove(2)
	fmt.Println(arr)

	zero, err := arr.Remove(100)
	if err != nil {
		fmt.Println(zero)
	}
	fmt.Println(arr)

	arr.RemoveElement(4)
	fmt.Println(arr)

	arr.RemoveFirst()
	fmt.Println(arr)

	arr1 := array.MakeArray0[student](20)
	arr1.AddLast(student{name: "Alice", score: 98})
	arr1.AddLast(student{name: "Bobo", score: 100})
	arr1.AddLast(student{name: "Charles", score: 66})
	fmt.Println(arr1)

	isExist := arr1.Contains(student{name: "Charles"})
	fmt.Println(isExist)
}
